const mongoose = require('mongoose')

const schema = new mongoose.Schema(
  {
    name: { type: String },
    categories: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Category' }],
    content: { type: String }
  },
  {
    timestamps: { createdAt: 'created', updatedAt: 'updated' }
  }
)

module.exports = mongoose.model('Article', schema)
